<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.shangji{
		color: #f37b1d; border-bottom: #f37b1d 2px solid; padding-top: 50px; text-align: center;
	}
	.xiaji{
		color: #f37b1d; border-left: #f37b1d 2px solid; height: 50px; writing-mode: vertical-lr; padding-top: 5px;
	}
	.xiajilist{
		background-color: #3bb4f2; color: #fff;
	}
	.itemline{
		display: flex;
	}
	.itemline img{
		border: #ddd 1px solid;
	}
	.itemline .left{
		width: 70px; height: 70px;
	}
	.itemline .right{
		flex: 1;
	}
	.click-infoblank{cursor: pointer;}
</style>

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>会员详情</title>
</head>
<body>
<!-- <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> <a _href="welcome.html" class="fun-toindex" href="javascript:;">首页</a> <span class="c-gray en">&gt;</span> 会员管理 <span class="c-gray en">&gt;</span> 会员详情 <a class="btn btn-success radius r mr-20 reload" style="line-height:1.6em;margin-top:3px" href="javascript:;" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
	<span class="r" style="margin-top: -2px; box-sizing: border-box;">
	    
	    <select name="gc_type" id="gc_type" class="select" style="width: auto; height: 31px; vertical-align: middle;">
	        <option value="" selected="">类型</option>
	        <option value="1">普通分类</option>
	        <option value="2">沐熙自营</option>

	    </select>
	    <button name="" id="search" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
	</span>
</nav> -->
<div class="pd-10">
	

	<div class="mt-20">
		<div class="row cl">
			<div class="col-5">
				<div class="panel panel-success">
					<div class="panel-header">当前用户</div>
					<div class="panel-body" id="myinfo">
						
						
						
					</div>
				</div>
			</div>
			<div class="col-1">
				<div class="shangji">上级 ></div>
			</div>
			<div class="col-5"> 
				<div class="panel panel-primary" id="clickup">
					<div class="panel-header">上级用户</div>
					<div class="panel-body" id="upinfo">暂无上级</div>
				</div>
			</div>
			<!-- <div class="btn btn-secondary-outline radius col-2">检测重复</div> -->
		</div>

		<div class="row cl">
			<div class="col-2"> </div>
			<div class="col-8 xiaji">下级 ></div>
		</div>

		<div class="">
			<table class="table table-border table-bordered table-bg table-hover table-sort">
			<!-- <table class="table table-border table-bordered  table-hover table-sort xiajilist"> -->
				<thead>
					<tr class="text-c sort0">
						<th width="60" class="fun-sort" data-name="id" data-flag="0">ID</th>
						<th width="100">用户名</th>
						<th width="60">头像</th>
						<!-- <th width="100">真实姓名</th> -->
						<th width="60">用户级别</th>
						<th width="80">联系电话</th>


						<th>地址</th>
						<th width="100">加入时间</th>
						<th width="100">最后登录时间</th>
						<!-- <th width="100">最后登录IP</th> -->
						<!-- <th width="120">状态</th> -->
						<!-- <th width="40">操作</th> -->
					</tr>
				</thead>
				<tbody id="content_sp" class="text-c">
					
				</tbody>
			</table>
		</div>

		<div class="cl pd-5 bg-1 bk-gray mt-10"> 
			<span class="r pt-5"  style="line-height: 35px;" id="page"></span>
			<span class="r mr-10"  style="line-height: 40px;" id="dataall"></span>  
		</div>
	</div>

	

</div>

<!-- 用户信息模板 -->
<script id="test-userinfo" type="text/html">
	<div class="click-infoblank" data-id="<%=info_my.uid%>">
		<div class="itemline">
			<div class="left"><img class="avatar size-XL radius" src="<%=info_my.user_avatar%>"></div>
			<div class="right">
				<div><%=info_my.user_name%> (id:<%=info_my.uid%>) <span class="r c-orange"><%=info_my.score_sn%></span></div>
				<div><%=info_my.realname%></div>
				<div><%=info_my.user_mobile%></div>
				<div>余额：<%=info_my.distributor_cost%></div>
			</div>
		</div>
	</div>
</script>

<!-- 模版 -->
<script id="test" type="text/html">
<% for (x in list) { %>
	<tr class="text-c va-m click-infoblank" data-id="<%=list[x].uid%>">
<!-- 		<td class="valueid"><input name="" type="checkbox" value="<%=list[x].uid%>"></td> -->
		<td><%=list[x].uid%>
			<!-- <a href="javascript:;" onClick="_open('订单详情','order-detail.html?oid=<%=list[x].user_id%>','90%','70%',true)" style="text-decoration: underline;">
				
			</a> -->
		</td>
		
		<td><%=list[x].user_name%></td>
		<td><img class="pic-thumb" src="/Manage/images/blank.gif" data-lazy="<%=list[x].user_avatar%>"></td>
		<!-- <td><%=list[x].realname%></td> -->
		<td><%=list[x].score_sn%></td>
		<td>
			<%=list[x].user_mobile%>
		</td>




		<td>
			<%=list[x].user_address%>
		</td>
		<td><%=list[x].user_addtime%></td>

		<td><%=list[x].user_login_time%></td>
		<!-- <td><%=list[x].user_login_ip%></td>		 -->
	</tr>

<%}%>
</script>

<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script>
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script>

<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 
<script type="text/javascript" src="lib/laypage/laypage.js"></script> 
<script src="/Manage/js/lazyload.min.js"></script>

<script type="text/javascript">
	var id=getUrlParam('mid');

	function getinfo(id){
		$.getJSON(API_USER+'?distributor='+id,function(data){
            if(!checkStatus(data)) return;//判断登录
            // 当前用户
            $("#myinfo").empty();
            var data_my={'info_my':data.datas.user_info};
            var html_my=template('test-userinfo',data_my);
            $("#myinfo").html(html_my);
            // 上级用户
            $("#upinfo").html("没有上级");
            if(data.datas.user_up!==null){
            	var data_up={'info_my':data.datas.user_up};
	            var html_up=template('test-userinfo',data_up);
	            $("#upinfo").html(html_up);
            }

            var API=API_USER+'?is_distributor=1&user_down='+id;
			loaddata(API,1,true);
            
        })
	}

	
	            // 下级用户
	            // $("#downlist").empty();
	            // $("#dataall").html('共有数据：<strong>'+data.datas.user_down.length+'</strong> 条');//总数据量
	            // if(data.datas.user_down.length>0){
	            // 	var data_down={'list':data.datas.user_down};
		           //  var html_down=template('test-downlist',data_down);
		           //  $("#downlist").html(html_down);

		           //  lazy.init();
	            // }else{
	            // 	$("#downlist").html('<tr><td colspan="11"><div class="Huialert Huialert-success">暂无下级</div></td></tr>');
	            // }
	
	if(id!=null){
		getinfo(id);
	}else{
		layer.msg('参数缺失',{icon:2,time:1000});
	}
	$(document).on('click','.click-infoblank',function(){
		var id=$(this).data("id");
		getinfo(id);

	})


</script>

</body>
</html>